package com.znufe.exam.viewmodel.admin.subCourse;

import com.znufe.exam.domain.SubCourse;
import com.znufe.exam.domain.subcourse.SubCourseResponseObject;
import com.znufe.exam.utility.DateTimeUtil;
import com.znufe.exam.viewmodel.BaseVM;
import lombok.Data;

/**
 * @author gong
 */
@Data
public class SubCoursePageResponseVm extends BaseVM {
    private Integer id;

    private String subCourseName;

    private String subtitle;

    private String lecturerName;

    private String videoLength;

    private String gmtCreate;

    private Integer status;

    public static SubCoursePageResponseVm from(SubCourseResponseObject object){
        SubCoursePageResponseVm vm = modelMapper.map(object,SubCoursePageResponseVm.class);
        vm.setGmtCreate(DateTimeUtil.dateFormat(object.getGmtCreate()));
        return vm;
    }
}
